package net.goodapp.model;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据库中字段与对应实体类的映射信息，注意如果表中多个字段组成联合主键，则需要手动修改生成的代码
 * @author zhou.jin-qiao
 *
 */
public class TableInfo {
	/**
	 * 实体类对应的所有列信息的集合
	 */
	private List<ColumnInfo> columnInfos;
	/**
	 * 数据表对应的实体类的名称
	 */
	private String entityName;
	/**
	 * 是否忽略生成相关代码，如果为true，则不会生成对应的Java和XMLMapper相关的代码
	 */
	private boolean ignored;
	/**
	 * 当前表中定义为主键的列名，注意如果为多字段联合主键需要手动修改相应代码
	 */
	private String primaryKeyColumnName;
	/**
	 * 当前表中主键的信息集合，如果是多字段组成的联合主键，则会存在多个元素，如果未指定主键，则是空集合
	 */
	private List<PrimaryKeyInfo> primaryKeyInfos;
	/**
	 * 当前表中主键对应的符合命名规范的属性名
	 */
	private String primaryKeyName;
	/**
	 * 当前表中主键对应的Java数据类型
	 */
	private String primaryKeyType;
	/**
	 * 实体类对应的注释
	 */
	private String remarks;
	/**
	 * 与实体类对应的表名
	 */
	private String tableName;
	
	public TableInfo(){
		columnInfos=new ArrayList<ColumnInfo>();
		primaryKeyInfos=new ArrayList<PrimaryKeyInfo>();
	}
	
	public List<ColumnInfo> getColumnInfos() {
		return columnInfos;
	}

	public String getEntityName() {
		return entityName;
	}

	public String getPrimaryKeyColumnName() {
		return primaryKeyColumnName;
	}
	
	public List<PrimaryKeyInfo> getPrimaryKeyInfos(){
		return primaryKeyInfos;
	}
	
	public String getPrimaryKeyName() {
		return primaryKeyName;
	}
	
	public String getPrimaryKeyType() {
		return primaryKeyType;
	}
	public String getRemarks() {
		return remarks;
	}
	public String getTableName() {
		return tableName;
	}
	/**
	 * 获取是否忽略生成相关代码
	 * @return
	 */
	public boolean isIgnored() {
		return ignored;
	}
	public void setColumnInfos(List<ColumnInfo> columnInfos) {
		this.columnInfos = columnInfos;
	}
	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}
	/**
	 * 设置是否忽略生成相关代码
	 * @return
	 */
	public void setIgnored(boolean ignored) {
		this.ignored = ignored;
	}
	public void setPrimaryKeyColumnName(String primaryKeyColumnName) {
		this.primaryKeyColumnName = primaryKeyColumnName;
	}
	public void setPrimaryKeyInfos(List<PrimaryKeyInfo> primaryKeyInfos){
		this.primaryKeyInfos=primaryKeyInfos;
	}
	public void setPrimaryKeyName(String primaryKeyName) {
		this.primaryKeyName = primaryKeyName;
	}
	public void setPrimaryKeyType(String primaryKeyType) {
		this.primaryKeyType = primaryKeyType;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
}
